const Koa = require('koa');
const router = require("koa-router")();
const app = new Koa();
const bodyParser = require('koa-bodyparser');
const serve = require('koa-static');
router.get('/', (ctx, next) => {
    const {name} = ctx.query;
    console.log(name);
   ctx.body="666"
});
router.post('/', (ctx, next) => {
    const {name} = ctx.request.body;
    console.log(name);
   ctx.body="666"
});
app.use(serve(__dirname + "/publish/index.js"))
app.use(bodyParser());
app.use(router.routes(),router.allowedMethods());
app.listen(5000)